﻿using System;
using WeiXinPF.Common;
using WeiXinPF.Templates;

namespace WeiXinPF.Web.modules.cdrt.smart
{
    public partial class beautiful_city : TBasePage
    {
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            BLL.wx_templates tBll = new BLL.wx_templates();
            templateIndexFileName = tBll.GetTemplatesFileNameByWid(wid);
            if (string.IsNullOrEmpty(templateIndexFileName))
            {
                errInitTemplates = Constants.MessageNoTempate;
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            /*
            var widInt = MyCommFun.RequestWid();
            var thisUrl = MyCommFun.getWebSite() + "/modules/cdrt/smart/citizen_advice.aspx?wid=" + widInt;
            var bll = new BLL.wx_userweixin();
            var uWeiXinModel = bll.GetModel(widInt);
            base.OAuth2BaseProc(uWeiXinModel, "citizen_advice", thisUrl);
            */

            tPath = MyCommFun.GetRootPath() + "/modules/cdrt/smart/templates/beautiful_city.html";
            TemplateMgr template = new TemplateMgr(tPath, wid);
            template.tType = TemplateType.ScenicIndex;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(templateIndexFileName, wid);
        }
    }
}